package com.ndp.fb.enums.adresource;

import lombok.Getter;

/**
 * Created by infi.he on 2015/4/7.
 */
@Getter
public enum AdResourceUploadStatus {
    init(0),
    uploading(2),
    success(1),
    fail(-1);

    private int status;


    private AdResourceUploadStatus(int status) {
        this.status = status;
    }

    /**
     * 根据type获取AdResourceUploadStatus
     *
     * @param status
     * @return
     */
    public static AdResourceUploadStatus getAdResourceUploadStatus(int status) {
        for (AdResourceUploadStatus c : AdResourceUploadStatus.values()) {
            if (c.status == status) {
                return c;
            }
        }
        return null;
    }
}
